package 第五章多重循环;
import java.util.Scanner;
public class 求出三个班的成绩 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        for (int i=1;i<=3;i++){
        System.out.println("第"+i+"个班");
        int sum=0,max=0,min=0,avg=0;
        for (int a=1;a<=5;a++){
            System.out.print("请输入第"+a+"个同学的成绩：");
            int result=input.nextInt();
            sum+=result;
            if (a==1) {
                min=result;
                max=result;
            }
                if (result>max){
                    max=a;
                }
                if (result<min){
                    min=a;
                }
        }
            System.out.println("本班的最低分："+min);
            System.out.println("本班的最高分："+max);
            System.out.println("本班的平均成绩："+(avg=sum/5));
            System.out.println("本班的总分："+sum);
    }
}
}

